<?php

namespace App\Listeners;

//use Illuminate\Support\Facades\Redis;
use App\Events\AddSkuEvent;

class UpdateSkuAttrCache
{   
    public function __construct()
    {
        //
    }

    public function handle(AddSkuEvent $event)
    {
        if(true){
            \Cache::forget(CACHE_SKU_ATTR.':'.$event->product->id);

            \Cache::put(CACHE_SKU_ATTR.':'.$event->product->id, $event->product->attrs);
        }
    }
}
